//
//  QDMoreViewController.swift
//  QDMetroClient
//
//  Created by YueWen on 2019/3/18.
//  Copyright © 2019 YueWen. All rights reserved.
//

import UIKit

/// 空列表的控制器,现在用于模拟乘客服务下的问卷、投票
private final class QDNullTableViewController: NWTableViewController {
    
    /// 导航标题
    var itemTitle: String? = nil
    
    convenience init(title: String?) {
        self.init()
        itemTitle = title
    }
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        navigationItem.title = itemTitle
        view.showTextHUD(text: "无更多数据")
        tableView.mj_footer.endRefreshingWithNoMoreData()
    }
    
    
    override func headerRefreshBeginHandler() {
        view.showTextHUD(text: "无更多数据")
        endHeaderRefreshing()
    }
}



/// 更多功能
final class QDMoreViewController: QDLargeTitleViewController {

    override var titles: [String] {
        return ["问卷","投票"]
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        largeTableHeaderView.title = "更多功能"
    }
    
    
    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        
        let viewController = QDNullTableViewController(title: titles[indexPath.row])
        ritl_topNavigationPush(viewController, animated: true)
    }
}
